package basicType;

import com.alibaba.fastjson.JSON;

import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author Created by chenxin34 on 2018/11/8 下午5:46.
 */
public class JsonTest {
    public static void main(String[] args) {
        Map<Integer, List<Long>> a  = new HashMap<>();
        a.put(1, Arrays.asList(1L,2L));
        System.out.println(a);
        String s = JSON.toJSONString(a);
        System.out.println(s);

        String json = "{1:[1,2]}";
        Map<Integer, List<Long>> parse = JSON.parseObject(json, Map.class);
        System.out.println(parse);
    }
}
